<script setup lang="ts">

import SearchTop from "@/components/index/search/SearchTop.vue";
import {useRouter} from "vue-router";

const onClickLeft = () => history.back();

const router = useRouter()
const handleSearch = (keyword)=>{
    // 根据keywords进行界面跳转
    router.push({
        name: 'searchResult',
        params: {keyword}
    })
}
</script>

<template>
    <van-nav-bar
            :fixed=true
            :placeholder=true
            title="搜索"
            left-text="返回"
            left-arrow
            @click-left="onClickLeft"
    />
  <!-- 双向绑定用户输入的内容，监听到用户点击搜索的事件   -->
    <search-top  @search="handleSearch"></search-top>
</template>

<style scoped lang="less">

</style>